﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;

namespace XMLInput
{
    class ValidationUtils
    {
        public static bool IsPersonalNameValid(string personalName)
        {
            string pattern = @"\A[A-Z]{1}[a-z]+\Z";
            bool valid = Regex.IsMatch(personalName, pattern);
            return valid;
        }
        public static bool IsSsnValid(string ssn)
        {
            string pattern = @"\A[0-9]{3}\-[0-9]{2}\-[0-9]{4}\Z";
            bool valid = Regex.IsMatch(ssn, pattern);
            return valid;
        }
        public static bool IsPhoneValid(string ssn)
        {
            string pattern = @"\A08[0-9]{8}\Z";
            bool valid = Regex.IsMatch(ssn, pattern);
            return valid;
        }
        public static bool IsEmailValid(string ssn)
        {
            string pattern = @"\A[a-zA-Z0-9_\-]+@[a-zA-Z]+\.[a-zA-Z]+\Z";
            bool valid = Regex.IsMatch(ssn, pattern);
            return valid;
        }
        public static bool IsWebSiteValid(string ssn)
        {
            string pattern = @"\A((www\.)|(http\:\/\/)){1}[a-zA-Z0-9_\-]+\.[a-zA-Z]+\Z";
            bool valid = Regex.IsMatch(ssn, pattern);
            return valid;
        }

    }
}
